import React from 'react';

import BoxItem from '../../../components/BoxItem';
import BorderTable from '../components/BorderTable';

import { Button, DatePicker, Form, Input, Select } from 'antd';

const { RangePicker } = DatePicker;

export default function InventoryAdjustment() {
	const columns = [
		{ title: '单据编码', dataIndex: 'documentCode', key: 'documentCode' },
		{ title: '调出仓库', dataIndex: 'fromWarehouse', key: 'fromWarehouse' },
		{ title: '调入仓库', dataIndex: 'toWarehouse', key: 'toWarehouse' },
		{ title: '商品总数', dataIndex: 'totalProducts', key: 'totalProducts' },
		{ title: '业务日期', dataIndex: 'businessDate', key: 'businessDate' },
		{ title: '调拨状态', dataIndex: 'transferStatus', key: 'transferStatus' },
		{ title: '入库时间', dataIndex: 'storageTime', key: 'storageTime' },
		{ title: '备注', dataIndex: 'remarks', key: 'remarks' },
		{ title: '操作', dataIndex: 'operation', key: 'operation' }
	];

	const dataSource = [
		{
			key: '1',
			documentCode: 'DOC001',
			fromWarehouse: '仓库A',
			toWarehouse: '仓库B',
			totalProducts: 120,
			businessDate: '2024-11-01',
			transferStatus: '已完成',
			storageTime: '2024-11-02 10:00',
			remarks: '正常调拨',
			operation: ['修改', '详情', '关闭']
		},
		{
			key: '2',
			documentCode: 'DOC002',
			fromWarehouse: '仓库C',
			toWarehouse: '仓库D',
			totalProducts: 150,
			businessDate: '2024-11-03',
			transferStatus: '进行中',
			storageTime: '2024-11-04 14:00',
			remarks: '需要核实',
			operation: ['修改', '详情', '关闭']
		},
		{
			key: '3',
			documentCode: 'DOC003',
			fromWarehouse: '仓库B',
			toWarehouse: '仓库A',
			totalProducts: 200,
			businessDate: '2024-11-05',
			transferStatus: '已完成',
			storageTime: '2024-11-06 09:30',
			remarks: '库存充足',
			operation: ['修改', '详情', '关闭']
		},
		{
			key: '4',
			documentCode: 'DOC004',
			fromWarehouse: '仓库D',
			toWarehouse: '仓库E',
			totalProducts: 180,
			businessDate: '2024-11-07',
			transferStatus: '已取消',
			storageTime: '2024-11-08 11:00',
			remarks: '调拨失败',
			operation: ['修改', '详情', '关闭']
		},
		{
			key: '5',
			documentCode: 'DOC005',
			fromWarehouse: '仓库F',
			toWarehouse: '仓库G',
			totalProducts: 250,
			businessDate: '2024-11-09',
			transferStatus: '已完成',
			storageTime: '2024-11-10 16:45',
			remarks: '补货调拨',
			operation: ['修改', '详情', '关闭']
		},
		{
			key: '6',
			documentCode: 'DOC006',
			fromWarehouse: '仓库G',
			toWarehouse: '仓库F',
			totalProducts: 300,
			businessDate: '2024-11-11',
			transferStatus: '进行中',
			storageTime: '2024-11-12 13:30',
			remarks: '紧急调拨',
			operation: ['修改', '详情', '关闭']
		},
		{
			key: '7',
			documentCode: 'DOC007',
			fromWarehouse: '仓库A',
			toWarehouse: '仓库C',
			totalProducts: 50,
			businessDate: '2024-11-13',
			transferStatus: '已完成',
			storageTime: '2024-11-14 15:00',
			remarks: '部分调拨',
			operation: ['修改', '详情', '关闭']
		},
		{
			key: '8',
			documentCode: 'DOC008',
			fromWarehouse: '仓库B',
			toWarehouse: '仓库D',
			totalProducts: 400,
			businessDate: '2024-11-15',
			transferStatus: '已取消',
			storageTime: '2024-11-16 12:15',
			remarks: '产品问题',
			operation: ['修改', '详情', '关闭']
		},
		{
			key: '9',
			documentCode: 'DOC009',
			fromWarehouse: '仓库E',
			toWarehouse: '仓库A',
			totalProducts: 350,
			businessDate: '2024-11-17',
			transferStatus: '进行中',
			storageTime: '2024-11-18 18:00',
			remarks: '跨区域调拨',
			operation: ['修改', '详情', '关闭']
		},
		{
			key: '10',
			documentCode: 'DOC010',
			fromWarehouse: '仓库F',
			toWarehouse: '仓库G',
			totalProducts: 120,
			businessDate: '2024-11-19',
			transferStatus: '已完成',
			storageTime: '2024-11-20 10:30',
			remarks: '定期调拨',
			operation: ['修改', '详情', '关闭']
		}
	];
	return (
		<div>
			<BoxItem>
				<Button style={{ marginRight: '20px' }} size="large" type="primary">
					新建报损单
				</Button>
				<Button size="large">导出</Button>
			</BoxItem>
			<BoxItem>
				<Form
					layout="inline" // 使用 inline 布局使所有字段并排显示
					style={{ maxWidth: '100%' }}
				>
					<Form.Item label="状态" style={{ width: '150px' }} wrapperCol={{ span: 15 }}>
						<Select defaultValue="请选择">
							<Select.Option value="未盘点">未盘点</Select.Option>
							<Select.Option value="盘点中">盘点中</Select.Option>
							<Select.Option value="已完成">已完成</Select.Option>
							<Select.Option value="已调帐">已调帐</Select.Option>
						</Select>
					</Form.Item>

					<Form.Item label="创建时间" style={{ width: '300px' }} wrapperCol={{ span: 18 }}>
						<RangePicker />
					</Form.Item>
					<Form.Item style={{ width: '400px' }} wrapperCol={{ span: 20 }}>
						<Button style={{ marginRight: '20px' }}>今</Button>
						<Button style={{ marginRight: '20px' }}>昨</Button>
						<Button style={{ marginRight: '20px' }}>近7天</Button>
						<Button>近30天</Button>
					</Form.Item>
					<Form.Item>
						<Button type="primary" style={{ marginRight: '20px' }}>
							搜索
						</Button>
						<Button>重置</Button>
					</Form.Item>
				</Form>
			</BoxItem>
			<BoxItem>
				<BorderTable columns={columns} dataSource={dataSource} />
			</BoxItem>
		</div>
	);
}
